package es

import (
	"fcs-api/src/app/model"

	elastic "github.com/elastic/go-elasticsearch/v6"
)

func GetEsClient() (*elastic.Client, error) {

	cfg := elastic.Config{
		Addresses: []string{
			model.Base.ESHost,
		},
	}
	client, err := elastic.NewClient(cfg)

	if err != nil {
		return nil, err
	}

	return client, nil
}
